\documentclass{article}
 
\usepackage[pdftex,active,tightpage]{preview}
\usepackage{tikz}
\usetikzlibrary{snakes}
\usetikzlibrary{arrows}
\makeatletter
 
\begin{document}
\begin{preview}
	%%
	\begin{tikzpicture}[scale=0.35]
	
	%% Now Draw the octree ...
	  \draw [help lines]
	  		 [step = 2cm]       (0,0) grid (8,8);
	  
	  \foreach \x in {2,6}
	  	\foreach \y in {2,6}
	  		\draw [help lines, step=1cm] (\x,\y) grid +(2,2);
	  
	  \foreach \x in {0,4}
	  	\foreach \y in {0,4}
	  		\draw [help lines, step=1cm] (\x,\y) grid +(2,2);
	  		  
	    % The scene   
	 		% draw background ...
	    \filldraw[fill=green, fill opacity=0.3] (0,0) rectangle +(8,8);
	 
	 		% draw first set of boxes ... red 
	 		\foreach \x in {2,6}
	 			\foreach \y in {2,6}
	 				\filldraw[fill=red, fill opacity=0.3] (\x,\y) rectangle +(1,1);
	 		
	 		% draw first set of boxes ... red 
	 		\foreach \x in {1,5}
	 			\foreach \y in {0,4}
	 				\filldraw	[fill=blue, fill opacity=0.3] (\x,\y) rectangle +(1,1);
	
		%% The histogram ,,,
		%% red = 4, blue = 4, green = 32, total = 40
		\filldraw[fill=red, fill opacity=0.3] (0.5,-2) rectangle +(0.6,0.2);
		\filldraw[fill=blue, fill opacity=0.3] (1.5,-2) rectangle +(0.6,0.2);
		\filldraw[fill=green, fill opacity=0.3] (2.5,-2) rectangle +(0.6,1.6);
		
		\draw [->] (0,-2) -- (4,-2);
		\draw [->] (0,-2) -- (0,-0.2);
		
		\node at (6,-1) {$\textsc{H = 0.64}$};
	\end{tikzpicture} %%
\end{preview}
\end{document}